package com.insurance.common.enums;

/**
 * 通用枚举类
 *
 * @version 1.0
 * @date 2020/9/20
 **/
public enum CommonEnum {

    LOGIN_SUCCESS(0, "登录成功"),
    LOGIN_ERROR(1, "登录失败"),
    LOGIN_VALIDATE_ERROR(1, "验证码错误"),
    LOGIN_INFO_ERROR(1, "用户名密码错误"),

    GET_TOKEN_SUCCESS(0, "获取token成功"),
    GET_TOKEN_ERROR(1, "获取token失败"),

    LOGOUT_SUCCESS(0, "登出成功"),
    LOGOUT_ERROR(1, "登出失败"),

    LOGIN_OUT_SUCCESS(0, "登出成功"),

    AUTHENTICATION_ERROR(401, "权限不足"),

    TOKEN_ERROR(999, "凭证错误"),
    TOKEN_TIME_OUT(999, "凭证超时"),
    USER_TOKEN_ERROR(1, "用户凭证超时"),

    FORM_VALIDATE_ERROR(1, "表单校验错误"),

    SAVE_SUCCESS(0, "保存成功"),
    SAVE_ERROR(1, "保存失败"),

    UPDATE_SUCCESS(0, "修改成功"),
    UPDATE_ERROR(1, "修改失败"),

    DELETE_SUCCESS(0, "删除成功"),
    DELETE_ERROR(1, "删除失败"),

    OPERATION_SUCCESS(0, "操作成功"),
    OPERATION_ERROR(1, "操作失败"),

    QUERY_SUCCESS(0, "查询成功"),
    QUERY_ERROR(1, "查询失败"),

    SIGN_ERROR(1, "签名错误"),

    QUERY_ERROR_NODATA(1, "数据不存在"),
    DATA_ERROR_SAME(1, "存在相同数据"),

    AUTHENTICATION(1, "企业已认证"),
    UN_AUTHENTICATION(0, "企业未认证"),
    UN_PASS(0, "企业已认证, 未审核"),

    SYSTEM_ERROR(-1, "系统繁忙");

    private int code;

    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    CommonEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
